<include file="Publics/head"/>
<body class="no-skin">
<include file="Publics/header"/>
<div class="main-container" id="main-container">
    <script type="text/javascript">
        try {
            ace.settings.check('main-container', 'fixed')
        } catch (e) {
        }
    </script>

    <include file="Publics/sidebar"/>
    <div class="main-content">
        <div class="main-content-inner">
            <!-- #section:basics/content.breadcrumbs -->
            <include file="Publics/breadcrumbs"/>

            <!-- /section:basics/content.breadcrumbs -->
            <div class="page-content">
                <include file="Publics/set"/>

                <!-- /section:settings.box -->
                <div class="row">
                    <div class="col-xs-12">
                        <!-- PAGE CONTENT BEGINS -->
                        <form class="form-horizontal" id="form" role="form" method="post" action="{:U('update')}">

                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-1">
                                    微信名 </label>
                                <div class="col-sm-9">
                                    <input type="text" name="wechatname" id="wechatname" placeholder="微信名"
                                           class="col-xs-10 col-sm-5" value="{$wxSetting.wechatname}">
                                </div>
                            </div>
                            <div class="space-4"></div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-1">
                                    Token </label>
                                <div class="col-sm-9">
                                    <input type="text" name="token" id="token" placeholder="Token"
                                           class="col-xs-10 col-sm-5" value="{$wxSetting.token}">
                                </div>
                            </div>
                            <div class="space-4"></div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-1">
                                    AppID </label>
                                <div class="col-sm-9">
                                    <input type="text" name="appid" id="appid" placeholder="AppID"
                                           class="col-xs-10 col-sm-5" value="{$wxSetting.appid}">
                                </div>
                            </div>
                            <div class="space-4"></div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-1">
                                    AppSecret </label>
                                <div class="col-sm-9">
                                    <input type="text" name="appsecret" id="appsecret" placeholder="AppSecret"
                                           class="col-xs-10 col-sm-5" value="{$wxSetting.appsecret}">
                                </div>
                            </div>
                            <div class="space-4"></div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-1">
                                    EncodingAESKey </label>
                                <div class="col-sm-9">
                                    <input type="text" name="encodingaeskey" id="encodingaeskey" placeholder="EncodingAESKey"
                                           class="col-xs-10 col-sm-5" value="{$wxSetting.encodingaeskey}">
                                </div>
                            </div>
                            <div class="space-4"></div>

                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-2"> 公众号描述 </label>
                                <div class="col-sm-9">
                                    <textarea name="notice" id="notice" placeholder="描述" class="col-xs-10 col-sm-5" rows="5">{$wxSetting.notice}</textarea>
                                </div>
                            </div>

                            <div class="col-md-offset-2 col-md-9">
                                <button class="btn btn-info submit" type="button">
                                    <i class="icon-ok bigger-110"></i>
                                    提交
                                </button>

                                &nbsp; &nbsp; &nbsp;
                                <button class="btn" type="reset">
                                    <i class="icon-undo bigger-110"></i>
                                    重置
                                </button>
                            </div>
                        </form>
                        <!-- PAGE CONTENT ENDS -->
                    </div><!-- /.col -->
                </div><!-- /.row -->
            </div><!-- /.page-content -->
        </div>
    </div><!-- /.main-content -->
    <include file="Publics/footer"/>

</div><!-- /.main-container -->

<include file="Publics/footerjs"/>

<!-- inline scripts related to this page -->
<script type="text/javascript">
    $(".submit").click(function () {
    	//console.log($('#form').serialize());
    	$.ajax({
			type: "post",
			url: "{:U('WxManage/updateWxchat')}",
			dataType: 'JSON',
			data: $('#form').serialize(),
			error: function () {
				return false;
			},
			success: function (data) {
				bootbox.alert({  
                    buttons: {  
                       ok: {label: '确定',className: 'btn-danger'}  
                    },  
                    message: data,  
                    callback: function() {  
                      	location.reload(); 
                    },  
                    title: "系统提示",  
                });
			}
		});
    })
</script>
</body>
</html>
